﻿@model Inovout.Account.Web.Models.AuthorizeInfo
@{
    Layout = "~/Views/Shared/_SignLayout.cshtml";
    ViewBag.Title = "授权用户";
}

<header class="reg_header">
    <img src="~/Styles/Themes/Google/Images/logo_2x.png" /><span><a href='@Url.Action("SignOut", "Account", new { returnUrl = ViewBag.ReturnUrl })'>退出</a></span>
</header>
<div class="w30 outBox">
    <div class="wgt">
        <div class="w-1 inBox">你正在使用 @Model.ClientApp 账户访问<strong>OAuth2.0</strong></div>
        <div class="w-1 inBox oauthRequest">
            <div class="wgt">
                <div class="w8">
                    <img id="oauthPicture" src="http://clay.phpme.info/userfiles/image/2011/01/28/1296179908.7759.png" />
                </div>
                <div class="w12">
                    <div class="w-1">提供授权的 @Model.ClientApp 的信息</div>
                    <img src="~/Styles/Themes/Google/Images/get.png" />
                    <div class="w-1">提供 @Model.ClientApp 的增值服务</div>
                    <img src="~/Styles/Themes/Google/Images/returnInfo.png" />
                </div>
                <div class="w8">
                    <img id="personHead" src="~/Styles/Themes/Google/Images/avatar_2x.png" />
                </div>
            </div>
        </div>
        <div class="w-1 inBox">
            <p>授权后，您将允许应用OAuth2.0访问或操作以下数据，为您提供更加优质的服务:</p>
            @foreach (var title in Model.Scope)
            {
                <p>@title；</p>
            }
        </div>
        <div class="w-1 inBox">账户名：@ViewBag.Membership.Name </div>
        <div class="w-1 inBox">
            @using (Html.BeginForm("AuthorizeResponse", "OAuth"))
            {
                @Html.Hidden("IsApproved")
                @Html.Hidden("client_id", (object)Model.AuthorizationRequest.ClientIdentifier)
                @Html.Hidden("redirect_uri", (object)Model.AuthorizationRequest.Callback)
                @Html.Hidden("state", (object)Model.AuthorizationRequest.ClientState)
                @Html.Hidden("scope", (object)DotNetOpenAuth.OAuth2.OAuthUtilities.JoinScopes(Model.AuthorizationRequest.Scope))
                @Html.Hidden("response_type", Model.AuthorizationRequest.ResponseType == DotNetOpenAuth.OAuth2.Messages.EndUserAuthorizationResponseType.AccessToken ? "token" : "code")
                <div id="responseButtonsDiv" class="bottomBox">
                    <input type="submit" value="授权" onclick="document.getElementsByName('IsApproved')[0].value = true; return true;" />
                    <input type="submit" value="取消" onclick="document.getElementsByName('IsApproved')[0].value = false; return true;" />
                </div>
            }
        </div>
    </div>
</div>

